﻿namespace EasyToolkit.BindingTemplates.Definitions.Binding
{
    using System;
    using EasyToolkit.BindingTemplates.Context;

    class BindingDefinitionRoot : BindingDefinition
    {
        public override string Name
        { get { return null; } }

        override public object UpdateDataSource(object dataSource, object data)
        { 
            return null; 
        }

        override public object ResolveBinding(object dataSource)
        {
            return null;
        }

        #region static public methods
        static public BindingDefinitionRoot CreateInstance(Type sourceType)
        {
            BindingDefinitionDescription definitionDescription = new BindingDefinitionDescription() { IsReadOnly = true };

            BindingDefinitionRoot bindingDefinition = new BindingDefinitionRoot() { BindingType = sourceType,
                                                                                    DefinitionDescription = definitionDescription
                                                                                  };
            if (bindingDefinition.BindingType != null)
                bindingDefinition.ManageCollectionStatus();
            return bindingDefinition;
        }
        #endregion
    }
}
